<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>固定资产管理系统</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<meta name="MobileOptimized" content="320">
	<!-- BEGIN GLOBAL MANDATORY STYLES -->          
	<link href="${ctx}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->
	<!-- BEGIN THEME STYLES --> 
	<link href="${ctx}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/themes/light.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/jquery-multi-select/css/multi-select.css" />
	<link href="${ctx }/css/custom.css" rel="stylesheet" type="text/css"/>

	<link href="${ctx}/frontend/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
   
   	<link href="${ctx}/frontend/assets/css/pages/portfolio.css" rel="stylesheet" type="text/css"/>

	<link href="${ctx}/frontend/assets/plugins/fancybox/source/jquery.fancybox.css" rel="stylesheet" />              
    <link rel="stylesheet" href="${ctx}/frontend/assets/plugins/revolution_slider/css/rs-style.css" media="screen">
    <link rel="stylesheet" href="${ctx}/frontend/assets/plugins/revolution_slider/rs-plugin/css/settings.css" media="screen"> 
    <link href="${ctx}/frontend/assets/plugins/bxslider/jquery.bxslider.css" rel="stylesheet" />       
	<!-- END THEME STYLES -->	
	<link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed page-full-width">
	<!-- BEGIN HEADER -->   
	<%@include file="../include/header.jsp" %>
	<!-- END HEADER -->
	
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<div class="page-content">			
			<!-- BEGIN PAGE HEADER-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
						物资移交
					</h3>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->          
			<div class="row">
				<div class="col-md-12">					
					<!-- BEGIN SAMPLE TABLE PORTLET-->
					<div class="portlet box green">
						<div class="portlet-title">
							<div class="caption"><i class="fa fa-cogs"></i>物资信息</div>
							<div class="tools">
								<a href="javascript:;" class="collapse"></a>
							</div>
						</div>
						<div class="portlet-body flip-scroll">							
							<form class="form-horizontal" method="POST" action="" id="yiJiaoForm" role="form">
								<div style="text-align:right;">									
									<a class="btn blue" id="yiJiaoAN"><i class="fa fa-search"></i>&nbsp;&nbsp;移交</a>									
									<a class="btn green" onclick="window.close()"><i class="fa fa-plus"></i>&nbsp;&nbsp;取消</a>
								</div>
								<input name="wuZiId" value="${wuZi.id }" type="hidden">
								<div class="col-md-12">
									<div class="row">
										<div class="form-group">
											<label class="col-md-2 control-label">资产编号</label>
											<label class="col-md-4 control-label" style="text-align:left;">${wuZi.ziChanBH}</label>
											<label class="col-md-2 control-label">物资类别</label>
											<label class="col-md-4 control-label" style="text-align:left;">${wuZi.wuZiLB.leibieMC}</label>
										</div>
									</div>
									<div class="row">
										<div class="form-group">
											<label class="col-md-2 control-label">物资名称</label>
											<label class="col-md-4 control-label" style="text-align:left;">${wuZi.wuZiMC}</label>
											<label class="col-md-2 control-label">品牌</label>
											<label class="col-md-4 control-label" style="text-align:left;">${wuZi.pinPai}</label>
										</div>
									</div>
									<div class="row">
										<div class="form-group">
											<label class="col-md-2 control-label">型号</label>
											<label class="col-md-4 control-label" style="text-align:left;">${wuZi.guiGeXH}</label>
											<label class="col-md-2 control-label">产品序列号</label>
											<label class="col-md-4 control-label" style="text-align:left;">${wuZi.chanPinXLH}</label>
										</div>
									</div>									
									<div class="row">
										<div class="form-group">
											<label class="col-md-2 control-label">存放地点</label>
											<div class="col-md-9">
												<input type="text" class="form-control" id="cunFangD" name="xinCunFangD" value="${wuZi.cunFangD }" placeholder="存放地点">
											</div>
										</div>
									</div>
									<div class="row">
										<div class="form-group">
											<label class="col-md-2 control-label">移交部门名称</label>
											<div class="col-md-4">
												<select name="depId" id="depId" class="form-control">
													<option value="">请选择...</option>
													<c:forEach items="${depList }" var="u">
														<option value="${u.id }"><c:forEach var="item" varStatus="status" begin="1" end="${u.cengJi}">&nbsp;&nbsp;&nbsp;&nbsp;</c:forEach>${u.depName }</option>
													</c:forEach>
												</select>
											</div>
											<label class="col-md-2 control-label">移交人</label>
											<div class="col-md-4">
												<select name="userId" id="userId" class="form-control"></select>
											</div>
										</div>
									</div>
									<div class="row">
										<div class="form-group">
											<label class="col-md-2 control-label">移交原因</label>
											<div class="col-md-9">
												<textarea rows="3" id="yiJiaoYY" name="yiJiaoYY" class="form-control"></textarea>
											</div>
										</div>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
	<%@include file="../include/footer.jsp" %>
	<!-- END FOOTER -->
	
	<script src="${ctx}/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>    
	<script src="${ctx}/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
	<script src="${ctx}/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>

	<script src="${ctx}/assets/scripts/form-components.js"></script>
	<script type="text/javascript" src="${ctx}/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
	<script type="text/javascript" src="${ctx}/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
	<script type="text/javascript" src="${ctx}/assets/plugins/clockface/js/clockface.js"></script>
	<script type="text/javascript" src="${ctx}/assets/plugins/bootstrap-daterangepicker/moment.min.js"></script>
	<script type="text/javascript" src="${ctx}/assets/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
	<script type="text/javascript" src="${ctx}/frontend/assets/plugins/revolution_slider/rs-plugin/js/jquery.themepunch.plugins.min.js"></script>
    <script type="text/javascript" src="${ctx}/frontend/assets/plugins/revolution_slider/rs-plugin/js/jquery.themepunch.revolution.min.js"></script> 
    <script type="text/javascript" src="${ctx}/frontend/assets/plugins/bxslider/jquery.bxslider.min.js"></script>    
    <script src="${ctx}/frontend/assets/scripts/index.js"></script>
	<!-- END CORE PLUGINS -->
	<script src="${ctx}/assets/scripts/app.js"></script>
	
	<script>
		jQuery(document).ready(function() {
		   App.init();
		   
		   $.ajax({
			   type:"GET",
			   url:"${ctx}/wuzi/getWuZiFenTanBM.do?id=${wuZi.id }",
			   success:function(data){
				   $('#fenTanBL').html(data);
			   }
		   });
		});
		
		$('#tianJiaFTBM').bind('click',function(){			
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/addFenTanBM.do",
				data:$('#wuZiForm').serialize(),
				async:false,
				success:function(data){
					$('#fenTanBL').html(data);					
				}
			});
		});
		
		var shanChuFTBM=function(id){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/shanChuFTBM.do",
				data:{
					"id":id,
					"wuZiId":"${wuZi.id}"
				},
				async:false,
				success:function(data){
					$('#fenTanBL').html(data);
				}
			});
		}
		
		$('#depId').bind('change',function(){			
			$.ajax({
				type:"POST",
				url:"${ctx}/system/getUserByDep.do",
				data:{
					"depId":$('#depId').val()
				},
				async:false,
				success:function(data){
					$('#userId').html(data);
				}
			});
		});
		
		$('#yiJiaoAN').bind("click",function(){
			$.ajax({
				type:"POST",
				data:$('#yiJiaoForm').serialize(),
				url:"${ctx}/wuzi/panDianYiJiaoSave.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert("请将物资找到，并告知固资管理员！");
						window.opener.location.reload();
						window.close();
					}else if(data.result=="conflict"){
						alert("有其他流程正在进行中，不能提交");
						window.close();
					}else{
						alert("提交申请失败！请重新提交");
					}
				}
			});
		});
	</script>
</body>
<!-- END BODY -->
</html>
